﻿@using Humanizer
@using MyAspNetCoreTodo.Dtos
@model ToDoViewModel
@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
    
*@
@{
    ViewData["Title"] = "管理您的列表";
}
<div class="panel panel-default todo-panel">
    <div class="panel-heading">@ViewData["Title"]</div>

    <table class="table table-hover">
        <thread>
          <tr>
              <td>&#x2714;</td>
                <td>事项</td>
                <td>时间</td>

              </tr>
        </thread>
        @foreach (var item in Model.Items)
        {
            <tr>
                <td>
                    <form asp-action="MarkDone" method="POST">
                        <input type="checkbox" class="done-checkbox">
                        <input type="hidden" name="id" value="@item.Id" />

                    </form>
                </td>
                <td>@item.Title</td>
                <td>@item.DueAt.Humanize()</td>
            </tr>
        }
    </table>
    <div class="panel-footer add-item-form">
        @await Html.PartialAsync("AddItemPartial", new TodoItemDto())
    </div>
</div>
